/**
 * @file OutputWriterFactory.cpp
 *
 * Wybór formatu zapisu obserwacji - implementacja.
 *
 * @author Zbigniew Siciarz
 * @date 2009
 * @version 2.0.0
 * @since 2.0.0
 */

#include "OutputWriterFactory.h"

#include "Exceptions.h"
#include "PtogzOutputWriter.h"
#include "AavsoOutputWriter.h"

namespace Dogz
{
    OutputWriter* OutputWriterFactory::getWriter(QString format)
    {
        format = format.toUpper();

        if ("PTOGZ" == format || "SSW" == format)
        {
            return new PtogzOutputWriter;
        }
        else if("AAVSO" == format)
        {
            return new AavsoOutputWriter;
        }
        else
        {
            throw Exception(QObject::tr("Nieznany format zapisu: %1").
                    arg(format));
        }
    }
}
